package homeTask3;

import java.util.Collections;
import java.util.List;

public class BubbleSorter<T extends Comparable<? super T>> implements Sorter<T> {

	@Override
	public List<T> sort(List<T> list) {
		for(int i = 0; i < list.size(); i++){
			for(int j = i + 1; j < list.size(); j++){
				if(list.get(i).compareTo(list.get(j)) > 0){
					Collections.swap(list, i, j);
				}
			}
		}
		return list;
	}
}
